package com.cloudsigns.factorymanager2.produce.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.cloudsigns.factorymanager2.BaseActivity;
import com.cloudsigns.factorymanager2.R;
import com.cloudsigns.factorymanager2.engineering.customview.ListViewForScrollView;

public class ProduceProductWarehousingActivity extends BaseActivity {
    private RelativeLayout rl_back;
    private TextView tv_title;
    private TextView tv_product_name, tv_engineering_name, tv_project_name;
    private ImageView img_arrow_down;
    private LinearLayout ll_content;
    private TextView tv_specifition_size, tv_dispatch_num, tv_warehousing_num, tv_complete_num;
    private ImageView img_submit_storage;
    private ListViewForScrollView listview;

    // listview item 点击跳转 ProduceWarehousingInformationActivity

    @Override
    protected void onBaseCreate(Bundle savedInstanceState) {
        setContentView(R.layout.layout_produce_product_warehousing);
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        rl_back = findViewById(R.id.rl_back);
        tv_title = findViewById(R.id.tv_title);
        tv_product_name = findViewById(R.id.tv_product_name);
        tv_engineering_name = findViewById(R.id.tv_engineering_name);
        tv_project_name = findViewById(R.id.tv_project_name);
        img_arrow_down = findViewById(R.id.img_arrow_down);
        ll_content = findViewById(R.id.ll_content);
        tv_specifition_size = findViewById(R.id.tv_specifition_size);
        tv_dispatch_num = findViewById(R.id.tv_dispatch_num);
        tv_warehousing_num = findViewById(R.id.tv_warehousing_num);
        tv_complete_num = findViewById(R.id.tv_complete_num);
        img_submit_storage = findViewById(R.id.img_submit_storage);
        listview = findViewById(R.id.listview);
    }

    @Override
    protected void initData(Bundle savedInstanceState) {
        tv_title.setText(getResources().getString(R.string.product_storage));

        img_submit_storage.setBackgroundResource(R.mipmap.arrow_down_icon);
    }

    @Override
    public void setListener() {
        rl_back.setOnClickListener(this);
        img_arrow_down.setOnClickListener(this);
        img_submit_storage.setOnClickListener(this);
    }

    @Override
    public void widgetClick(View view) {
        switch (view.getId()) {
            case R.id.rl_back:
                finish();
                break;
            // 收缩
            case R.id.img_arrow_down:
                if (ll_content.getVisibility() == View.VISIBLE) {
                    ll_content.setVisibility(View.GONE);
                    img_arrow_down.setBackgroundResource(R.mipmap.arrow_down_icon);
                } else {
                    ll_content.setVisibility(View.VISIBLE);
                    img_arrow_down.setBackgroundResource(R.mipmap.arrow_top);
                }
                break;
            // 入库提交
            case R.id.img_submit_storage:
                Intent intent=new Intent(ProduceProductWarehousingActivity.this,ProduceWarehousingSubmitActivity.class);
                startActivity(intent);
                break;
        }
    }
}
